package com.oracleoaec.entity;

import java.io.Serializable;

public class Record implements Serializable{
	
	private static final long serialVersionUID = 1L;
	private long id;
	private String start_date;
	private String return_date;
	private double  payment;
	
	private User user;
	private Car car;//车里用所有的信息
	
	public User getUser() {
		return user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	public Car getCar() {
		return car;
	}

	public void setCar(Car car) {
		this.car = car;
	}

	public Record() {
	}
	
	
	
	public Record(long id, String start_date, String return_date, double payment,
			User user, Car car) {
		this.id = id;
		this.start_date = start_date;
		this.return_date = return_date;
		this.payment = payment;
		this.user = user;
		this.car = car;
	}

	public long getId() {
		return id;
	}
	public void setId(long id) {
		this.id = id;
	}
	public String getStart_date() {
		return start_date;
	}
	public void setStart_date(String start_date) {
		this.start_date = start_date;
	}
	public String getReturn_date() {
		return return_date;
	}
	public void setReturn_date(String return_date) {
		this.return_date = return_date;
	}
	public double getPayment() {
		return payment;
	}
	public void setPayment(double payment) {
		this.payment = payment;
	}
	
	@Override
	public String toString() {
		return this.getId()+"\t"+this.getCar().getId()+"\t"+this.getCar().getModel()+"\t"+
				this.getUser().getId()+"\t"+this.getUser().getUserName()+"\t"+
				this.getCar().getRent()+"\t"+getPayment()+"\t"+this.getCar().getComments()+"\t"+
				this.getCar().getBrandName()+"\t"+this.getCar().getTypeName()+"\t"+
				this.getStart_date()+"\t"+this.getReturn_date();
	}
	
	//编号	总租金	汽车名称	每日租金	备注	品牌	类型	借车时间		还车时间
	public String toString2() {
		return  this.getCar().getId()+"\t"+this.getPayment()+"\t"+
				this.getCar().getModel()+"\t"+this.getCar().getRent()+"\t"+
				this.getCar().getComments()+"\t"+this.getCar().getBrandName()+"\t"+
				this.getCar().getTypeName()+"\t"+getStart_date()+"\t"+getReturn_date();
	}
	
	public String toString3(){
		return car.getId()+"\t"+car.getModel()+"\t"+getPayment()+"\t"+
				   car.getRent()+"\t"+car.getComments()+"\t"+car.getBrandName()+"\t"+
		           car.getTypeName()+"\t"+getStart_date()+"\t\t"+getReturn_date();
	}
}
